cmake_minimum_required(VERSION 3.17)
project(wxTest)

set(CMAKE_CXX_STANDARD 20)

#add_library(/usr/include/wx-3.0/)
#add_library(/usr/lib/x86_64-linux-gnu/wx/include/gtk3-unicode-3.0/)
#find_library(wxWidgets)
#find_library(MY_LIB libmylib.a ./)
#target_link_libraries(${PROJECT_NAME} ${MY_LIB})
#find_package( "pthread" )
add_definitions("-D WXUSINGDLL")
#add_definitions("-D __WXGTK__")
add_definitions("-D __WXMSW__")
#target_compile_definitions( preference __WXMSW__ )
add_definitions("-D _DEBUG_" )

LINK_DIRECTORIES("H:/tmp/wxWidgets-3.1.3/x86_build/lib/vc_dll")
LINK_DIRECTORIES("H:/tmp/sqlite3/" )

#add_executable(wxTest main.cpp MyApp.h MyApp.cpp
#        PreferenceCore.h PreferenceCore.cpp
#        Preference.cpp Preference.h
#        Blog.cpp Blog.h PreferenceScreen.cpp PreferenceScreen.h
#        InputDialog.cpp InputDialog.h PreferencesFrame.cpp PreferencesFrame.h
#        SwitchControl.cpp SwitchControl.h DhBitmapButton.cpp DhBitmapButton.h TimerDemo.cpp TimerDemo.h)
#[STATIC | SHARED | MODULE]
#BUILD_SHARED_LIBS
#windows下，如果dll没有export任何信息，则不能使用SHARED，要标识为MODULE
add_library(preference MyTagApp.h MyTagApp.cpp )

target_include_directories(preference PUBLIC
        ${wxWidgets_INCLUDE_DIRS}
        "H:/tmp/sqlite3"
        )

#`wx-config --libs`
#-L/usr/lib/x86_64-linux-gnu
#-L/usr/lib/x86_64-linux-gnu -pthread   -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0
#-lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
#gtk2
#
#"wx_gtk2u_xrc-3.0" "wx_gtk2u_html-3.0" "wx_gtk2u_qa-3.0" "wx_gtk2u_adv-3.0" "wx_gtk2u_core-3.0"
target_link_libraries( preference
        sqlite3.lib
        ${wxWidgets_LIBRARIES} )

#test demo
#https://www.jianshu.com/p/8377431f96e3
#target名字和生成库的名字可以不一样
#set_target_properties(TARGET_NAME PROPERTIES OUTPUT_NAME LIB_OUTPUT_NAME)
#set_target_properties(MyApp PROPERTIES
#        COMPILE_DEFINITIONS _AFXDLL,_UNICODE,UNICODE,_BIND_TO_CURRENT_CRT_VERSION,_BIND_TO_CURRENT_MFC_VERSION
#        LINK_FLAGS "/ENTRY:\"wWinMainCRTStartup\"")
#"C:\Program Files\CMake\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - NMake Makefiles" H:\init\git_oschina\libs\assimp
#cmake -G "Your Generator" -D CMAKE_C_COMPILER=gcc-4.2 -D CMAKE_CXX_COMPILER=g++-4.2 path/to/your/source
#cmake .. -G "Visual Studio 2019" -A x64
#cmake .. -G "Visual Studio 16" -A ARM
#cmake .. -G "Visual Studio 16 2019" -A ARM64
#cmake .. -G "Visual Studio 2019"
#cmake .. -G "Visual Studio 16"
#cmake .. -G "Visual Studio 16 2019"
#$(CharacterSet)_build/$(ProjectName)\$(Configuration)_$(LibrariesArchitecture)
#$(CharacterSet)_build/$(ProjectName)\$(Configuration)_$(LibrariesArchitecture)\$(TargetName)$(TargetExt)